package com.cx.common.core.dto.response;

import com.cx.common.core.constant.RespEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

/**
 * 通用响应码
 * 业务项目响应码自行定义，只需实现 ServiceRespAssert 接口即可
 *
 * @author _
 * @date 2020-08-24
 */
@ToString
@Getter
@AllArgsConstructor
public enum RespCode implements RespEnum {

    /**
     * 通用响应码4位 从0开头
     */
    SUCCESS("0000", "成功", "成功", "Success"),
    UNKNOWN("0001", "未知异常-{0}", "未知异常-{0}", "Unknown error-{0}"),
    BAD_REQUEST("0002", "错误请求-{0}", "錯誤請求-{0}", "Error request-{0}"),
    BAD_PARAMETER("0003", "错误参数-{0}", "錯誤參數-{0}", "Error parameter-{0}"),
    UNAUTHORIZED("0004", "未认证请求", "未認證請求", "Unauthenticated request"),
    INTERNAL_SERVER_ERROR("0005", "服务器内部错误", "服務器內部錯誤", "Server internal error"),
    SERVICE_UNAVAILABLE("0006", "服务器繁忙，请稍后再试", "服務器繁忙，請稍後再試", "Server busy, please try again later"),
    SERVICE_RATE_LIMIT("0007", "服务限流访问", "服務限流訪問", "Service limited access"),
    SERVICE_DATA_FAIL("0008", "数据不合法", "數據不合法", "Illegal data"),
    FORBIDDEN("0009", "无权限访问", "無許可權訪問", "No access"),
    DATA_SAVE_ERROR("0010", "数据保存失败", "數據保存失敗", "Data saving failed"),
    ILLEGAL_INPUT("0011", "输入内容不合法", "輸入內容不合法", "Illegal input"),
    VERSION_ERROR("0012", "版本号格式错误", "版本號格式錯誤", "Version number format error"),
    NOT_SUPPORTED_METHOD("0013", "不支持的请求方法", "不支持的請求方法", "Not Supported Method"),


    ACCESS_TOKEN_EXPIRED("0111", "访问token过期", "訪問token過期", "Access token expired"),
    REFRESH_TOKEN_EXPIRED("0112", "刷新token过期", "刷新token過期", "Refresh token expired"),
    ACCOUNT_LOGIN_EXCEPTION("0113", "您的账号在其他地方登陆，请尝试重新登陆", "您的賬號在其他地方登陸，請嘗試重新登陸",
            "Your account is logged in elsewhere, please try to log in again"),
    NOT_TOKEN_EXCEPTION("0114", "token不存在", "token不存在", "token nonexistence"),

    ACCOUNT_CYPHER_FORMAT_ERROR("3134", "密码格式错误", "密碼格式錯誤", "Password format error"),
    ACCOUNT_AUTH_CODE_FORMAT_ERROR("3135", "验证码格式错误", "驗證碼格式錯誤", "Captcha format error"),
    ACCOUNT_NAME_FORMAT_ERROR("3136", "账号格式错误", "賬號格式錯誤", "Account format error"),
    ACCOUNT_NICK_NAME_FORMAT_ERROR("3137", "昵称格式错误", "暱稱格式錯誤", "Wrong nickname format"),
    ACCOUNT_ALREADY_EXISTS("3140", "账号已存在", "賬號已存在", "Account already exists"),
    ACCOUNT_NOT_EXISTS("3141", "账号不存在", "賬號不存在", "Account dose not exists"),
    ACCOUNT_AUTH_CODE_ERROR("3142", "验证码错误", "驗證碼錯誤", "Verification code error"),
    ACCOUNT_DISABLE("3143", "该账号已被禁用，请联系管理员", "該賬號已被禁用，請聯繫管理員",
            "The account has been disabled, please contact the administrator"),
    ACCOUNT_PASSWORD_ERROR("3143", "密码错误，请{0}分钟后重试", "密碼錯誤，請{0}分鐘後重試",
            "The password is wrong, please try again after {0} minutes"),
    ACCOUNT_LOGIN_INFO_ERROR("3144", "登录账户信息不存在，请重新登录", "登錄賬戶信息不存在，請重新登錄",
            "The login account information does not exist, please log in again"),
    CELL_PHONE_FORMAT_ERROR("3137", "手机号格式错误", "手機號格式錯誤", "Wrong format of mobile phone number"),
    SYSTEM_USER_PASSWORD_ERROR("3138", "账号密码错误", "賬號密碼錯誤", "Account password error"),
    SYSTEM_USER_EXIST_ERROR("3139", "用户存在,请重新输入", "用戶存在,請重新輸入", "User exists, please re-enter"),
    SYSTEM_ACCOUNT_OVER_MAX_NUM("3028", "账号数量超过上限,请联系管理员!", "賬號數量超過上限,請聯繫管理員!",
            "The number of accounts exceeds the upper limit, please contact the administrator!"),
    SYSTEM_ROLE_OVER_MAX_NUM("3028", "角色数量超过上限,请联系管理员!", "角色數量超過上限,請聯繫管理員!",
            "The number of roles exceeds the upper limit, please contact the administrator!"),
    SYSTEM_ROLE_DEL_ERROR("3029", "角色删除失败,请联系管理员!", "角色刪除失敗,請聯繫管理員!",
            "Administrator failed to delete the role, please contact!"),
    SYSTEM_ROLE_NAME_ERROR("3030", "角色名称不能超过六位,请重新输入!", "角色名稱不能超過六位,請重新輸入!",
            "The role name cannot exceed six characters, please re-enter!"),
    SYSTEM_ROLE_DEL_EXIST_ERROR("3031", "该角色已经被删除,请联系管理员", "該角色已經被刪除,請聯繫管理員",
            "The role has been deleted. Please contact the administrator"),
    SYSTEM_ROLE_DATA_ERROR("3032", "角色数据不合法", "角色數據不合法", "Illegal role data"),
    SYSTEM_ROLE_UPDATE_ERROR("3124", "角色更新失败", "角色更新失敗", "Role update failed"),
    SYSTEM_USER_DEL_ERROR("3125", "该用户已被删除,请联系管理员", "該用戶已被刪除,請聯繫管理員",
            "The user has been deleted, please contact the administrator"),
    SYSTEM_USER_RESET_KEY_ERROR("3126", "该用户密钥已或密码被重置,请重新登陆", "該用戶密鑰或密碼已被重置,請重新登陸",
            "The user key or password has been reset, please log in again"),
    SYSTEM_USER_RESET_PASSWORD_ERROR("3126", "该用户密钥或密码已被重置,请重新登陆", "該用戶密鑰或密碼已被重置,請重新登陸",
            "The user key or password has been reset, please log in again"),
    SYSTEM_USER_DISTRIBUTION_AUTHORITY_ERROR("3127", "不能对此用户操作", "不能對此用戶操作", "You cannot operate on this user"),
    SYSTEM_USER_ROLE_ERROR("3128", "不能对此角色操作", "不能對此角色操作", "You cannot operate on this role"),
    SYSTEM_DISTRIBUTORID_NONNULL_ERROR("3129", "商户di不能为空", "商戶di不能爲空", "Merchant Di cannot be empty"),
    SYSTEM_APP_ID_ERROR("3130", "应用id不能为空", "應用id不能爲空", "Application ID cannot be empty"),
    SYSTEM_USERID_NULL_ERROR("3131", "角色Id参数错误", "角色Id參數錯誤", "Wrong role ID parameter"),
    SYSTEM_USER_NAME_NULL_ERROR("3132", "角色名称参数错误", "角色名稱參數錯誤", "Role name parameter error"),
    SYSTEM_CELL_PHONE_REPEAT_ERROR("3133", "绑定手机号码重复", "綁定手機號碼重複", "Binding mobile phone number duplicate"),
    SYSTEM_USER_DATA_ERROR("3134", "用户信息数据为空", "用戶信息數據為空", "The user information data is empty"),
    SYSTEM_USER_CODE_WORD_ERROR("3135", "暗语不能为空|不匹配", "暗語不能為空|不匹配", "Code words cannot be empty | Does not match"),
    SYSTEM_USER_PASSWORD_INCONSISTENCY_ERROR("3136", "两次密码输入不一致", "兩次密碼輸入不一致", "The two password entries are inconsistent"),
    SYSTEM_USER_IDENTITY_CODE_ERROR("3137", "身份证号码不合法", "身份證號碼不合法", "The ID number is invalid"),
    MENU_SUBMENU_EXISTS("4000", "存在子菜单，不允许删除", "存在子菜單，不允許刪除", "A submenu exists and is not allowed to be deleted"),
    ;


    private final String code;
    private final String msg;
    private final String traditionalChineseMsg;
    private final String englishMsg;
}
